<?php 
ob_start();
global $sessionID;
if(!session_id())
{
	session_start();
	$sessionID = session_id();
}

/*--------------------------------------------------------------------------------------------*/
/*  GET THEME NAME AND DEFINE  */
/*--------------------------------------------------------------------------------------------*/
$theme_name = get_current_theme();
#### Load languages setting
load_theme_textdomain($theme_name, get_template_directory() . '/languages/' );
#### Define theme name
define("THEMENAME", $theme_name);

require_once 'admins/myfunctions.php';
require_once 'admins/ajax_calls.php';
require_once 'templates/templates.php';

require_once 'admins/register-posttype.php';
require_once 'admins/register-taxonomies.php';

if(is_admin())
{
	
	#### support menu
	add_theme_support('menus');
	
	#### Support thumbnail
	add_theme_support('post-thumbnails', array('post','page','tin-tuc','sliders','dich-vu','tu-van','tin-tuc','khach-hang'));
	
	// change label set featured image
	function custom_admin_post_thumbnail_html( $content ) {
		return $content = str_replace( __( 'Set featured image' ), __( 'Hình đại diện Công trình (200x158 px)<br/> Hình slider Show(990x658 px)' ), $content);
	}
	add_filter( 'admin_post_thumbnail_html', 'custom_admin_post_thumbnail_html' );

	
	// reset cache
	require_once 'admins/submenu/admin_submenu.php';
	
}	

// rewrite
require_once 'admins/rewrites/remove-category-slug.php';
	
// include widget
require_once 'admins/widgets/widget.php';

// include widget
require_once 'admins/nhp-options.php';
require_once 'admins/breadcrums.php';

// shortcode
require_once 'admins/contact/contact.php';

/*****************************/
global $myoptions;
$myoptions = db_callback_mydata("mycache_transient_basic","db_basic_seting",86400);


// include jquery.lazy-master
require_once 'admins/jquery.lazy-master/lazy-loader.php';